<div class="layui-card-body ">
    <form class="layui-form" method="post" action="{{session('guard')=="admin"? route("admin.role.store") :route("system.role.store") }}" id="layer-form">
        @csrf
        <div class="layui-form-item">
            <label class="layui-form-label">选择守卫</label>
            <div class="layui-input-block">
                @if(session("guard")=="admin")
                    <select id="type" disabled lay-verify="required">
                        {!! Code::getOptionsByCode('GUARD','admin','--请选择--') !!}
                    </select>
                    <input name="data[guard_name]" value="admin" style="display: none"/>
                @else
                    <select id="type" name="data[guard_name]" lay-verify="required">
                        <option value="">--请选择--</option>
                        <option value="system">平台</option>
                        <option value="admin">站点</option>
                    </select>
                @endif
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">角色名称</label>
            <div class="layui-input-block">
                <input type="text" name="data[name]" required value=""  lay-verify="required" placeholder="请输入角色名称" autocomplete="off" class="layui-input">
            </div>
        </div>

        @if(session("guard")=="system")
        <div class="layui-form-item" id="is_system">
            <label class="layui-form-label">选择类型</label>
            <div class="layui-input-block">
                <input type="radio" name="data[is_system]" value="1" title="系统">
                <input type="radio" name="data[is_system]" value="0" title="普通" checked>
            </div>
        </div>
        @else
            <input  name="data[is_system]" value="0" style="display: none;"/>
        @endif

    </form>
</div>
